-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add stream creation time in get stats api #632
fix: add stream creation time in get stats api #632
Conversation
Is this the correct issue this PR is fixing? |
My bad. I have corrected the issue number. Plus this PR is adding stream creation timestamp. Let me know if this is sufficient or we need first event timestamp as well? |
Thanks @gurjotkaur20 .
Quoting @logut from issue #587,
So, let's add the first event timestamp in the API as well. |
We can add an additional field in the Then return this in the |
Thanks for working on this ! |
Great catch, we'll have to keep updating the stream time. In this case, don't you think it is better to use SQL directly @logut ? |
b5d549d
to
adbae20
Compare
@nitisht I've added first event time. Please take a look. However, I've noticed one point. For example,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO there is a simpler way, we have something called .stream.json
per Stream - this file has a section called snapshot.manifest_list
, this points to all manifest.json
files (created per day)
To find the first query-able event time stamp, you could see the list snapshot.manifest_list, go to the first entry in this list which would be a manifest.json
file, in this manifest.json
, you can get the smallest p_timestamp
This approach would need max of two S3 calls and will be much cheaper computationally
@gurjotkaur20 now that #649 is merged, can we make progress here? |
Sure. Consolidating the changes required:
|
8be084b
to
adbae20
Compare
Thanks @gurjotkaur20 we'll review this shortly |
@gurjotkaur20 when I ingest one event at a time using postman, the code works as expected thread 'thread 'actix-rt|system:0|arbiter:3' panicked at actix-rt|system:0|arbiter:0thread 'server/src/storage/object_storage.rs' panicked at actix-rt|system:0|arbiter:4:216server/src/storage/object_storage.rs::thread '216actix-rt|system:0|arbiter:5:' panicked at 53' panicked at server/src/storage/object_storage.rs:21653:: parseable config is valid json: Error("EOF while parsing a value", line: 1, column: 0)server/src/storage/object_storage.rs:53note: run with Steps -
Please check. |
@nikhilsinhacloudsurfex I have tried running quest in container as well as on local but didn't find this issue. Please help in reproducing if you have any particular scenario in mind. |
log::error!("Failed to update manifest list in the snapshot {err:?}") | ||
} | ||
|
||
if let Ok(Some(first_event_at)) = catalog::get_first_event(store, &stream_name).await { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to do this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is here to update the first event timestamp after cleanup because after retention cleanup, first event timestamp would be different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved, good to merge
Changes does in the PR - 1. adds the first_event_at property (from the min value of p_timestamp of the first parquet file listed in the first manifest file from the snapshot of the stream.json) to the stats api and writes it to the stream.json file at the request of get stats. 2. updates the first_event_at in case of retention Fixes : parseablehq#587
Fixes #587
Description
Added stream creation time in the get stats api.